package cn.tedu.ezhaung_project.controller;

import cn.tedu.ezhaung_project.mapper.UserRegMapper;
import cn.tedu.ezhaung_project.pojo.dto.UserRegDTO;
import cn.tedu.ezhaung_project.pojo.entity.User;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class UserRegController {
    @Autowired
    UserRegMapper mapper;
    @RequestMapping("/reg")
    public void insert(@RequestBody UserRegDTO regDTO){
        User user=new User();
        BeanUtils.copyProperties(regDTO,user);
        mapper.insert(user);
    }

}
